package com.java.tutorials.spring.ClassPathResource;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
/**
 * Created by xuzhike on 2016/3/13.
 */
public class HelloClient {
    public static void main(String args[]) throws Exception

    {
        try
        {
            System.out.println("point1");

            Resource  res = new ClassPathResource("hello.xml");
            System.out.println("point2");

            BeanFactory  factory = new XmlBeanFactory(res);
            System.out.println("point3");

            Hello bean1 = (Hello)factory.getBean("hello");

            String s = bean1.sayhello("Joe");

            System.out.println(s);

        }catch(Exception e1){System.out.println(""+e1);}
    }
}
